package com.joe.file;

import java.io.File;
import java.io.IOException;
import java.util.ArrayList;

public class ListFiles {
	static ArrayList list = new ArrayList();
	static long count = 0;
	public static void listFiles(String FilerootFilePathPath) throws IOException{
		File rootFile = new File(FilerootFilePathPath);
		
		if(rootFile.isDirectory()){
			File[] files = rootFile.listFiles();
			for(int i=0;i<files.length;i++){
				listFiles(files[i].getAbsolutePath());
			}
		}else{
			//System.out.print(count++ + " ");
			String name = rootFile.getName();
			long time = rootFile.lastModified();
			long size = rootFile.length();
			if(list.contains(name+time+size)){
				System.out.println(rootFile.getAbsolutePath());
			}else{
				list.add(name+time+size);
			}
		}
	}
	
	/**
	 * @param args
	 * @throws IOException 
	 */
	public static void main(String[] args) throws IOException {
		// TODO Auto-generated method stub
		listFiles("f:\\");
	}

}
